import java.util.Scanner;
/**
 * @author caesar
 * @date 2025/6/28
 * @apiNote
 */

/*
赌数游戏：随机产生3个1-6的整数，如果三个数相等，那么称为“豹子”
如果三个数之和大于9，称为“大”，如果三个数之和小于等于9，称为“小”
用户从键盘输入押的是“豹子”、“大”、“小”，并判断是否猜对了
提示：随机数  Math.random()产生 [0,1)范围内的小数
 */
public class practice3_2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num1 = (int) (Math.random() * 6 + 1);
        int num2 = (int) (Math.random() * 6 + 1);
        int num3 = (int) (Math.random() * 6 + 1);

        System.out.print("请输入您的猜想");
        String guess = input.nextLine();

        boolean result = false;
//        switch (guess) {
//            case "豹子":
//                result = (num1 == num2 && num2 == num3);
//                break;
//            case "大":
//                result = (num1 + num2 + num3 > 9);
//                break;
//            case "小":
//                result = (num1 + num2 + num3 <= 9);
//        }
        switch (guess) {
            case "豹子" -> result = (num1 == num2 && num2 == num3);
            case "大" -> result = (num1 + num2 + num3 > 9);
            case "小" -> result = (num1 + num2 + num3 <= 9);
            default -> System.out.println("输入错误");
        }
        if (result) {
            System.out.println("恭喜你答对了");
        }
        //System.out.println(result ? "恭喜你答对了":"猜错了");
        System.out.println("num1 = " + num1);
        System.out.println("num2 = " + num2);
        System.out.println("num3 = " + num3);
        System.out.println("result = " + result);
    }
}
